import { $delete, $get, $post } from '@js/request'
import { OperateSchema } from '@src/components/schema/operate'

export async function delOperateRequest (caseid: string, operate: string) {
  const res = await $delete('/api/commission/case_operate', {
    caseid,
    operate
  })
  return res.data
}

export async function getOperateRequest (id: string): Promise<{
  used: OperateSchema[],
  unuse: OperateSchema[]
}> {
  const res = await $get(`/api/commission/case_operate/${id}`)
return res.data
}

export async function addOperateRequest (caseid: string, operate: string) {
  const res = await $post('/api/commission/case_operate', {
    caseid,
    operate
  })
}